(function($){ $(document).ready(function(){ var all_networks_opened=0; et_pb_fix_gallery_wrapper(); $('body').on('click', '.et_social_share', function(){ var $this_el=$(this), social_type=$this_el.data('social_type'), social_network=$this_el.data('social_name'), share_link='media'==social_type ? $this_el.data('social_link'):$this_el.prop('href'); update_stats_table(social_network, $this_el); if('like'===social_network){ return false; } var left=($(window).width()/2) -(550/2); var top=($(window).height()/2) -(450/2); var new_window=window.open(share_link, '', 'scrollbars=1, height=450, width=550, left=' + left + ', top=' + top); if(window.focus){ new_window.focus(); } return false; }); $('.et_social_follow').click(function(){ var $this_el=$(this), social_network=$this_el.data('social_name'); update_stats_table(social_network, $this_el); if('like'===social_network){ return false; }}); $('body').on('click', '.et_social_share_pinterest', function(){ if($(this).hasClass('et_social_pin_all')){ var left=($(window).width()/2) -(550/2), top=($(window).height()/2) -(450/2), share_link=$(this).attr('href'), new_window=window.open(share_link, '', 'scrollbars=1, height=450, width=550, left=' + left + ', top=' + top); if(window.focus){ new_window.focus(); }}else{ $('.et_social_pin_images_outer').fadeToggle(400); } return false; }); function get_url_parameter(param_name){ var page_url=window.location.search.substring(1); var url_variables=page_url.split('&'); for(var i=0; i < url_variables.length; i++){ var curr_param_name=url_variables[i].split('='); if(curr_param_name[0]==param_name){ return curr_param_name[1]; }} } function update_stats_table($social_network, $this_el){ var action=$this_el.data('social_type'), media_url='media'==action ? $this_el.closest('.et_social_media_wrapper').find('img').attr('src'):'', post_id=$this_el.data('post_id'), location=$this_el.data('location'), stats_data=''; stats_data=JSON.stringify({ 'action':action, 'network':$social_network, 'media_url':media_url, 'post_id':post_id, 'location':location }); $.ajax({ type:'POST', url:monarchSettings.ajaxurl, data:{ action:'add_stats_record_db', stats_data_array:stats_data, add_stats_nonce:monarchSettings.stats_nonce }, success:function(data){ if(true==data){ if('like'===action){ update_single_shares($this_el, '', post_id, $social_network, 'like'); } if('media'===action){ update_total_media_shares($this_el.closest('.et_social_media_wrapper')); update_single_shares($this_el, media_url, post_id, $social_network, 'media'); }} }}); } function append_share_counts($current_network){ var network=$current_network.data('social_name'), min_count=$current_network.data('min_count'), post_id=$current_network.data('post_id'), url=monarchSettings.pageurl!=='' ? monarchSettings.pageurl:window.location.href, label_div=$current_network.find('.et_social_network_label'), append_to=(0!=(label_div.length)) ? label_div:$current_network; $share_count_data=JSON.stringify({ 'network':network, 'min_count':min_count, 'post_id':post_id, 'url':url }); $.ajax({ type:'POST', url:monarchSettings.ajaxurl, data:{ action:'get_shares_count', share_count_array:$share_count_data, get_share_counts_nonce:monarchSettings.share_counts }, beforeSend:function(data){ append_to.append(''); }, success:function(data){ $current_network.find('span.et_social_placeholder').remove(); append_to.append(data); }}); } function append_total_shares($current_area){ var post_id=$current_area.data('post_id'), url=monarchSettings.pageurl!=='' ? monarchSettings.pageurl:window.location.href, append_to=$current_area; $share_total_count_data=JSON.stringify({ 'post_id':post_id, 'url':url }); $.ajax({ type:'POST', url:monarchSettings.ajaxurl, data:{ action:'get_total_shares', share_total_count_array:$share_total_count_data, get_total_counts_nonce:monarchSettings.total_counts }, beforeSend:function(data){ append_to.append(''); }, success:function(data){ append_to.find('span.et_social_placeholder').remove(); append_to.append(data); }}); } function append_follow_counts($current_area){ var network=$current_area.data('network'), min_count=$current_area.data('min_count'), index=$current_area.data('index'), append_to=$current_area; $follow_count_data=JSON.stringify({ 'network':network, 'min_count':min_count, 'index':index }); $.ajax({ type:'POST', url:monarchSettings.ajaxurl, data:{ action:'get_follow_counts', follow_count_array:$follow_count_data, get_follow_counts_nonce:monarchSettings.follow_counts }, beforeSend:function(data){ append_to.append(''); }, success:function(data){ $current_area.find('span.et_social_placeholder').remove(); append_to.append(data); }}); } function append_total_follows($current_area){ var append_to=$current_area; $.ajax({ type:'POST', url:monarchSettings.ajaxurl, data:{ action:'get_follow_total', get_total_counts_nonce:monarchSettings.total_counts }, beforeSend:function(data){ append_to.append(''); }, success:function(data){ append_to.find('span.et_social_placeholder').remove(); append_to.append(data); }}); } if($('.et_social_display_follow_counts').length){ $('.et_social_display_follow_counts').each(function(){ append_follow_counts($(this)); }); } if($('.et_social_follow_total').length){ $('.et_social_follow_total').each(function(){ append_total_follows($(this)); }); } if($('.et_social_total_share').length){ $('.et_social_total_share').each(function(){ append_total_shares($(this)); }); } if($('.et_social_display_count').length){ $('.et_social_display_count').each(function(){ append_share_counts($(this)); }); } if($('.et_social_media_wrapper').length&&$('.et_social_media_wrapper .et_social_totalcount').length){ $('.et_social_media_wrapper').each(function(){ update_total_media_shares($(this)); }); } if($('.et_social_media_wrapper').length&&$('.et_social_media_wrapper .et_social_withcounts').length){ $('.et_social_media_wrapper .et_social_share').each(function(){ var this_el=$(this), media_url=this_el.closest('.et_social_media_wrapper').find('img').attr('src'), post_id=this_el.data('post_id'), social_network=this_el.data('social_name'); update_single_shares(this_el, media_url, post_id, social_network, 'media'); }); } function update_total_media_shares($element){ if($('.et_social_totalcount').length){ var this_el=$element, media_url=this_el.find('img').attr('src'), post_id=this_el.find('.et_social_share').first().data('post_id'), media_data=JSON.stringify({ 'media_url':media_url, 'post_id':post_id }); $.ajax({ type:'POST', url:monarchSettings.ajaxurl, data:{ action:'get_media_shares_total', media_total:media_data, get_media_shares_total_nonce:monarchSettings.media_total }, success:function(data){ this_el.find('.et_social_totalcount_count').empty().append(data); }}); }} function update_single_shares($this_el, $media_url, $post_id, $network, $action){ if($('.et_social_withcounts').length){ var media_data=JSON.stringify({ 'media_url':$media_url, 'post_id':$post_id, 'network':$network, 'action':$action }); $.ajax({ type:'POST', url:monarchSettings.ajaxurl, data:{ action:'get_shares_single', media_single:media_data, get_media_shares_nonce:monarchSettings.media_single }, success:function(data){ $this_el.find('.et_social_count span').not('.et_social_count_label').empty().append(data); }}); }} function setCookieExpire(days){ var ms=days*24*60*60*1000; var date=new Date(); date.setTime(date.getTime() + ms); return "; expires=" + date.toUTCString(); } function checkCookieValue(cookieName, value){ return parseCookies()[cookieName]===value; } function parseCookies(){ var cookies=document.cookie.split('; '); var ret={}; for(var i=cookies.length - 1; i >=0; i--){ var el=cookies[i].split('='); ret[el[0]]=el[1]; } return ret; } function set_cookie($expire){ cookieExpire=setCookieExpire($expire); document.cookie='etSocialCookie=true' + cookieExpire; } function make_popup_visible($popup, $delay){ setTimeout(function(){ $popup.addClass('et_social_visible et_social_animated'); if($('.et_social_resize').length){ $('.et_social_resize').each(function(){ define_popup_position($(this)); }); }}, $delay); } function auto_popup(this_el, delay){ var $current_popup_auto=this_el; if(! $current_popup_auto.hasClass('et_social_animated')){ var $cookies_expire_auto=$current_popup_auto.data('cookie_duration') ? $current_popup_auto.data('cookie_duration'):false, $delay=delay; if((false!==$cookies_expire_auto&&! checkCookieValue('etSocialCookie', 'true'))||false==$cookies_expire_auto){ make_popup_visible($current_popup_auto, $delay); if(false!==$cookies_expire_auto){ set_cookie($cookies_expire_auto); }} }} if('true'==get_url_parameter('et_monarch_popup')){ $('.et_social_after_comment').each(function(){ var $current_popup=$(this); auto_popup($current_popup, 0); }); } if($('.et_social_auto_popup').length){ $('.et_social_auto_popup').each(function(){ var $current_popup_auto=$(this); auto_popup($current_popup_auto, ''!==$current_popup_auto.data('delay') ? $current_popup_auto.data('delay') * 1000:0); }); } $('.et_social_pinterest_window .et_social_close').on('click', function(){ $('.et_social_pin_images_outer').fadeToggle(400); }); $('body').on('click', '.et_social_icon_cancel', function(){ var this_el=$(this); if(this_el.parent().hasClass('et_social_flyin')){ $popup=this_el.parent(); }else{ $popup=this_el.parent().parent(); if($popup.hasClass('et_social_all_networks_popup')){ all_networks_opened=0; }} $popup.addClass('et_social_fadeout'); setTimeout(function(){ $popup.remove(); }, 800); return false; }); if($('.et_monarch_after_order').length){ $('.et_social_after_purchase').each(function(){ var $current_popup=$(this); if(! $current_popup.hasClass('et_social_animated')){ var $cookies_expire=$current_popup.data('cookie_duration') ? $current_popup.data('cookie_duration'):false, $delay=0; if((false!==$cookies_expire&&! checkCookieValue('etSocialCookie', 'true'))||false==$cookies_expire){ make_popup_visible($current_popup, $delay); if(false!==$cookies_expire){ set_cookie($cookies_expire); }} }}); } if($('.et_social_trigger_bottom').length){ $('.et_social_trigger_bottom').each(function(){ scroll_trigger($(this), true); }); } if($('.et_social_scroll').length){ $('.et_social_scroll').each(function(){ scroll_trigger($(this), false); }); } function scroll_trigger(this_el, is_bottom_trigger){ var current_popup_bottom=this_el; if(! current_popup_bottom.hasClass('et_social_animated')){ var cookies_expire_bottom=current_popup_bottom.data('cookie_duration') ? current_popup_bottom.data('cookie_duration'):false; if(true==is_bottom_trigger){ var scroll_trigger=$('.et_social_bottom_trigger').length ? $('.et_social_bottom_trigger').offset().top:$(document).height() - 500; }else{ var scroll_pos=this_el.data('scroll_pos') > 100 ? 100:this_el.data('scroll_pos'), scroll_trigger=100==scroll_pos ? $(document).height() - 10:$(document).height() * scroll_pos / 100; } $(window).scroll(function(){ if((false!==cookies_expire_bottom&&! checkCookieValue('etSocialCookie', 'true'))||false==cookies_expire_bottom){ if($(window).scrollTop() + $(window).height() > scroll_trigger){ current_popup_bottom.addClass('et_social_visible et_social_animated'); if($('.et_social_resize').length){ $('.et_social_resize').each(function(){ define_popup_position($(this)); }); } if(false!==cookies_expire_bottom){ set_cookie(cookies_expire_bottom); }} }}); }} if($('.et_social_trigger_idle').length){ $('.et_social_trigger_idle').each(function(){ var this_el=$(this); if(! this_el.hasClass('et_social_animated')){ var $cookies_expire_idle=this_el.data('cookie_duration') ? this_el.data('cookie_duration'):false, $idle_timeout=''!==this_el.data('idle_timeout') ? this_el.data('idle_timeout') * 1000:30000; if((false!==$cookies_expire_idle&&! checkCookieValue('etSocialCookie', 'true'))||false==$cookies_expire_idle){ $(document).idleTimer($idle_timeout); $(document).on("idle.idleTimer", function(){ make_popup_visible(this_el, 0); }); if(false!==$cookies_expire_idle){ set_cookie($cookies_expire_idle); }} }}); } $('.et_social_heading, .et_social_mobile_button').click(function(){ $this_mobile_div=$('.et_social_mobile'); $this_mobile_div.css({'display':'block' }); $('.et_social_mobile_button').removeClass('et_social_active_button'); if($this_mobile_div.hasClass('et_social_opened')){ $this_mobile_div.find('.et_social_networks').slideToggle(600); $this_mobile_div.removeClass('et_social_opened').addClass('et_social_closed'); $('.et_social_mobile_overlay').removeClass('et_social_visible_overlay'); $('.et_social_mobile_overlay').fadeToggle(600); }else{ $this_mobile_div.removeClass('et_social_closed').addClass('et_social_opened'); $this_mobile_div.find('.et_social_networks').slideToggle(600); $('.et_social_mobile_overlay').addClass('et_social_visible_overlay').css({ 'display':'block' }); }}); $('.et_social_mobile .et_social_close').click(function(){ $mobile_div=$('.et_social_mobile'); $mobile_div.fadeToggle(600); $('.et_social_mobile_button').addClass('et_social_active_button'); if($mobile_div.hasClass('et_social_opened')){ $('.et_social_mobile_overlay').fadeToggle(600); $mobile_div.removeClass('et_social_opened'); $mobile_div.find('.et_social_networks').fadeToggle(600); }}); if($('.et_social_inline').length){ if($('body').hasClass('et_pb_pagebuilder_layout')){ var top_inline=$('.et_social_inline_top'), bottom_inline=$('.et_social_inline_bottom'), divi_container='
'; if(top_inline.length){ $('.et_pb_section').not('.et_pb_fullwidth_section').first().prepend(divi_container).find('.et_pb_row').first().find('.et_pb_column').append(top_inline); } if(bottom_inline.length){ $('.et_pb_section').not('.et_pb_fullwidth_section').last().append(divi_container).find('.et_pb_row').last().find('.et_pb_column').append(bottom_inline); }} } function define_popup_position($this_popup){ setTimeout(function(){ var this_popup=$this_popup, networks_div=this_popup.find('.et_social_networks'), header_height=this_popup.find('.et_social_header').outerHeight(), total_count_height=this_popup.find('.et_social_totalcount').height(), extra_height=0 < total_count_height ? 20:0; this_popup.height(this_popup.find('.et_social_icons_container').innerHeight() + header_height + total_count_height + 20 + extra_height); var popup_max_height=this_popup.hasClass('et_social_popup_content') ? $(window).height():$(window).height() - 60; if(this_popup.hasClass('et_social_popup_content')&&768 < $(window).width()){ popup_max_height=popup_max_height - 50; } this_popup.css({ 'max-height':popup_max_height }); if(this_popup.hasClass('et_social_popup_content')){ var top_position=$(window).height() / 2 - this_popup.innerHeight() / 2; this_popup.css({ 'top':top_position + 'px' }); } var networks_div_height=this_popup.height() - header_height + total_count_height - extra_height; networks_div.height(networks_div_height); }, 400); } function set_mobile_sidebar_height(){ setTimeout(function(){ var mobile_div=$('.et_social_mobile'); if(!mobile_div.hasClass('et_social_opened')){ $('.et_social_mobile .et_social_networks').css({'display':'block'}); } if($('.et_social_active_button').length){ mobile_div.css({'display':'block'}); } var inner_contatiner_height=mobile_div.find('.et_social_icons_container').innerHeight() + 45; if(!mobile_div.hasClass('et_social_opened')){ $('.et_social_mobile .et_social_networks').css({'display':'none'}); } if($('.et_social_active_button').length){ mobile_div.css({'display':'none'}); } mobile_div.find('.et_social_networks').css({ 'max-height':inner_contatiner_height, 'height':inner_contatiner_height }); if($(window).height() < inner_contatiner_height){ var inner_height=$(window).height() - mobile_div.find('.et_social_heading').innerHeight() + 10; mobile_div.find('.et_social_networks').css({ 'height':inner_height }); }}, 400); } function set_sidebar_position(){ if($('.et_social_sidebar_networks').length){ var this_sidebar=$('.et_social_sidebar_networks'), top_position=$(window).height() / 2 - this_sidebar.innerHeight() / 2; top_position=0 > top_position ? 0:top_position; this_sidebar.css({ 'top':top_position + 'px' }); }} function set_media_wrapper_size(){ if($('.et_social_media_wrapper').length){ $('.et_social_media_wrapper').each(function(){ var this_wrapper=$(this), this_wrapper_media=this_wrapper.find('.et_social_media'), this_image=this_wrapper.find('img'), image_position=this_image.position(), image_left_offset=typeof image_position!=='undefined' ? image_position.left:0, this_image_height=this_image.height(), this_image_width=this_image.width(), this_wrapper_networks_height=this_wrapper.find('.et_social_networks').innerHeight(); this_wrapper.addClass(this_image.attr('class')); this_wrapper_media.css({ 'max-height':this_image_height }); this_wrapper_media.css({ 'height':this_wrapper_networks_height + 50 }); this_wrapper_media.width(this_image_width - 80); if(0!==image_left_offset){ this_wrapper_media.css({ 'left':image_left_offset + 20 }); }}); et_pb_fix_gallery_slider_icons_size(); }} function et_pb_fix_gallery_wrapper(){ var $media_wrappers_inside_gallery=$('.et_pb_gallery_grid .et_social_media_wrapper'); if(0 > $media_wrappers_inside_gallery.length){ return; } $media_wrappers_inside_gallery.each(function(){ var $this_wrapper=$(this); var $gallery_item=$this_wrapper.closest('.et_pb_gallery_image'); var $gallery_overlay=$gallery_item.find('.et_overlay'); if(0 < $gallery_overlay.length){ $this_wrapper.append($gallery_overlay); }}); } function et_pb_fix_gallery_slider_icons_size(){ var $gallery_slider_icons=$('.et_pb_gallery_fullwidth .et_social_media_wrapper'); if(0 > $gallery_slider_icons.length){ return; } var $all_galleries=$('.et_pb_gallery_fullwidth'); $all_galleries.each(function(){ var $this_gallery=$(this); var $this_gallery_media=$this_gallery.find('.et_social_media_wrapper .et_social_media'); if(0 > $this_gallery_media.length){ return; } var $first_icon_wrapper=$this_gallery_media.first(); var icons_width=$first_icon_wrapper.width(); var icons_height=$first_icon_wrapper.css('height'); var icons_max_height=$first_icon_wrapper.css('max-height'); $this_gallery_media.width(icons_width - 80); $this_gallery_media.height(icons_height); $this_gallery_media.css({ 'max-height':icons_max_height }); }); } $('body').on('click', '.et_social_open_all', function(){ all_networks_opened++; if(1==all_networks_opened){ var this_button=$(this), page_id=this_button.data('page_id'), permalink=this_button.data('permalink'), title=this_button.data('title'), media=typeof this_button.data('media')!=='undefined' ? this_button.data('media'):'', is_popup='popup'==this_button.data('location') ? 'true':'false'; $.ajax({ type:'POST', url:monarchSettings.ajaxurl, data:{ action:'generate_all_networks_popup', all_networks_page_id:page_id, all_networks_link:permalink, all_networks_title:title, all_networks_media:media, is_popup:is_popup, generate_all_window_nonce:monarchSettings.generate_all_window_nonce }, success:function(data){ if('false'==is_popup){ $('body').append(data); make_popup_visible($('.et_social_all_networks_popup'), 1); }else{ var popup_container=this_button.parent().closest('.et_social_popup_content'); this_button.parent().replaceWith(data); define_popup_position(popup_container); all_networks_opened=0; }} }); } return false; }); set_mobile_sidebar_height(); set_sidebar_position(); $(window).resize(function(){ if($('.et_social_resize').length){ $('.et_social_resize').each(function(){ define_popup_position($(this)); }); } if($('.et_social_mobile')){ set_mobile_sidebar_height(); } if($('.et_social_sidebar_networks').length){ set_sidebar_position(); } set_media_wrapper_size(); }); $('.et_social_hide_sidebar').click(function(){ $('.et_social_hide_sidebar').toggleClass('et_social_hidden_sidebar'); $('.et_social_sidebar_networks').toggleClass('et_social_hidden_sidebar et_social_visible_sidebar'); }); $(window).load(function(){ set_media_wrapper_size(); if($('.et_social_pin_images').length&&($('.et_social_all_button').length||$('.et_social_pinterest').length)){ var pin_container=$('.et_social_pin_images'), permalink=pin_container.data('permalink'), title=pin_container.data('title'), post_id=pin_container.data('post_id'), $i=0; $('img').each(function(){ if(! $(this).hasClass('avatar')){ var this_img=$(this).attr('src'), this_alt=$(this).attr('alt'); if(''!=this_img){ var pin_link='http://www.pinterest.com/pin/create/button/?url=' + permalink + '&media=' + this_img + '&description=' + title, this_img_container='
' + this_alt + '
'; $('.et_social_pin_images').append(this_img_container); $i++; }} }); if(0==$i){ $('.et_social_pin_images').append(monarchSettings.no_img_message); }} }); }); })(jQuery); !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){var b="ui-effects-",c=a; return a.effects={effect:{}},function(a,b){function c(a,b,c){var d=l[b.type]||{};return null==a?c||!b.def?null:b.def:(a=d.floor?~~a:parseFloat(a),isNaN(a)?b.def:d.mod?(a+d.mod)%d.mod:0>a?0:d.max")[0],o=a.each;n.style.cssText="background-color:rgba(1,1,1,.5)",m.rgba=n.style.backgroundColor.indexOf("rgba")>-1,o(k,function(a,b){b.cache="_"+a,b.props.alpha={idx:3,type:"percent",def:1}}),j.fn=a.extend(j.prototype,{parse:function(e,g,h,i){if(e===b)return this._rgba=[null,null,null,null],this;(e.jquery||e.nodeType)&&(e=a(e).css(g),g=b);var l=this,m=a.type(e),n=this._rgba=[];return g!==b&&(e=[e,g,h,i],m="array"),"string"===m?this.parse(d(e)||f._default):"array"===m?(o(k.rgba.props,function(a,b){n[b.idx]=c(e[b.idx],b)}),this):"object"===m?(e instanceof j?o(k,function(a,b){e[b.cache]&&(l[b.cache]=e[b.cache].slice())}):o(k,function(b,d){var f=d.cache;o(d.props,function(a,b){if(!l[f]&&d.to){if("alpha"===a||null==e[a])return;l[f]=d.to(l._rgba)}l[f][b.idx]=c(e[a],b,!0)}),l[f]&&a.inArray(null,l[f].slice(0,3))<0&&(l[f][3]=1,d.from&&(l._rgba=d.from(l[f])))}),this):void 0},is:function(a){var b=j(a),c=!0,d=this;return o(k,function(a,e){var f,g=b[e.cache];return g&&(f=d[e.cache]||e.to&&e.to(d._rgba)||[],o(e.props,function(a,b){if(null!=g[b.idx])return c=g[b.idx]===f[b.idx]})),c}),c},_space:function(){var a=[],b=this;return o(k,function(c,d){b[d.cache]&&a.push(c)}),a.pop()},transition:function(a,b){var d=j(a),e=d._space(),f=k[e],g=0===this.alpha()?j("transparent"):this,h=g[f.cache]||f.to(g._rgba),i=h.slice();return d=d[f.cache],o(f.props,function(a,e){var f=e.idx,g=h[f],j=d[f],k=l[e.type]||{};null!==j&&(null===g?i[f]=j:(k.mod&&(j-g>k.mod/2?g+=k.mod:g-j>k.mod/2&&(g-=k.mod)),i[f]=c((j-g)*b+g,e)))}),this[e](i)},blend:function(b){if(1===this._rgba[3])return this;var c=this._rgba.slice(),d=c.pop(),e=j(b)._rgba;return j(a.map(c,function(a,b){return(1-d)*e[b]+d*a}))},toRgbaString:function(){var b="rgba(",c=a.map(this._rgba,function(a,b){return null==a?b>2?1:0:a});return 1===c[3]&&(c.pop(),b="rgb("),b+c.join()+")"},toHslaString:function(){var b="hsla(",c=a.map(this.hsla(),function(a,b){return null==a&&(a=b>2?1:0),b&&b<3&&(a=Math.round(100*a)+"%"),a});return 1===c[3]&&(c.pop(),b="hsl("),b+c.join()+")"},toHexString:function(b){var c=this._rgba.slice(),d=c.pop();return b&&c.push(~~(255*d)),"#"+a.map(c,function(a){return a=(a||0).toString(16),1===a.length?"0"+a:a}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),j.fn.parse.prototype=j.fn,k.hsla.to=function(a){if(null==a[0]||null==a[1]||null==a[2])return[null,null,null,a[3]];var b,c,d=a[0]/255,e=a[1]/255,f=a[2]/255,g=a[3],h=Math.max(d,e,f),i=Math.min(d,e,f),j=h-i,k=h+i,l=.5*k;return b=i===h?0:d===h?60*(e-f)/j+360:e===h?60*(f-d)/j+120:60*(d-e)/j+240,c=0===j?0:l<=.5?j/k:j/(2-k),[Math.round(b)%360,c,l,null==g?1:g]},k.hsla.from=function(a){if(null==a[0]||null==a[1]||null==a[2])return[null,null,null,a[3]];var b=a[0]/360,c=a[1],d=a[2],f=a[3],g=d<=.5?d*(1+c):d+c-d*c,h=2*d-g;return[Math.round(255*e(h,g,b+1/3)),Math.round(255*e(h,g,b)),Math.round(255*e(h,g,b-1/3)),f]},o(k,function(d,e){var f=e.props,g=e.cache,i=e.to,k=e.from;j.fn[d]=function(d){if(i&&!this[g]&&(this[g]=i(this._rgba)),d===b)return this[g].slice();var e,h=a.type(d),l="array"===h||"object"===h?d:arguments,m=this[g].slice();return o(f,function(a,b){var d=l["object"===h?a:b.idx];null==d&&(d=m[b.idx]),m[b.idx]=c(d,b)}),k?(e=j(k(m)),e[g]=m,e):j(m)},o(f,function(b,c){j.fn[b]||(j.fn[b]=function(e){var f,g=a.type(e),i="alpha"===b?this._hsla?"hsla":"rgba":d,j=this[i](),k=j[c.idx];return"undefined"===g?k:("function"===g&&(e=e.call(this,k),g=a.type(e)),null==e&&c.empty?this:("string"===g&&(f=h.exec(e),f&&(e=k+parseFloat(f[2])*("+"===f[1]?1:-1))),j[c.idx]=e,this[i](j)))})})}),j.hook=function(b){var c=b.split(" ");o(c,function(b,c){a.cssHooks[c]={set:function(b,e){var f,g,h="";if("transparent"!==e&&("string"!==a.type(e)||(f=d(e)))){if(e=j(f||e),!m.rgba&&1!==e._rgba[3]){for(g="backgroundColor"===c?b.parentNode:b;(""===h||"transparent"===h)&&g&&g.style;)try{h=a.css(g,"backgroundColor"),g=g.parentNode}catch(i){}e=e.blend(h&&"transparent"!==h?h:"_default")}e=e.toRgbaString()}try{b.style[c]=e}catch(i){}}},a.fx.step[c]=function(b){b.colorInit||(b.start=j(b.elem,c),b.end=j(b.end),b.colorInit=!0),a.cssHooks[c].set(b.elem,b.start.transition(b.end,b.pos))}})},j.hook(g),a.cssHooks.borderColor={expand:function(a){var b={};return o(["Top","Right","Bottom","Left"],function(c,d){b["border"+d+"Color"]=a}),b}},f=a.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(c),function(){function b(b){var c,d,e=b.ownerDocument.defaultView?b.ownerDocument.defaultView.getComputedStyle(b,null):b.currentStyle,f={};if(e&&e.length&&e[0]&&e[e[0]])for(d=e.length;d--;)c=e[d],"string"==typeof e[c]&&(f[a.camelCase(c)]=e[c]);else for(c in e)"string"==typeof e[c]&&(f[c]=e[c]);return f}function d(b,c){var d,e,g={};for(d in c)e=c[d],b[d]!==e&&(f[d]||!a.fx.step[d]&&isNaN(parseFloat(e))||(g[d]=e));return g}var e=["add","remove","toggle"],f={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(b,d){a.fx.step[d]=function(a){("none"!==a.end&&!a.setAttr||1===a.pos&&!a.setAttr)&&(c.style(a.elem,d,a.end),a.setAttr=!0)}}),a.fn.addBack||(a.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}),a.effects.animateClass=function(c,f,g,h){var i=a.speed(f,g,h);return this.queue(function(){var f,g=a(this),h=g.attr("class")||"",j=i.children?g.find("*").addBack():g;j=j.map(function(){var c=a(this);return{el:c,start:b(this)}}),f=function(){a.each(e,function(a,b){c[b]&&g[b+"Class"](c[b])})},f(),j=j.map(function(){return this.end=b(this.el[0]),this.diff=d(this.start,this.end),this}),g.attr("class",h),j=j.map(function(){var b=this,c=a.Deferred(),d=a.extend({},i,{queue:!1,complete:function(){c.resolve(b)}});return this.el.animate(this.diff,d),c.promise()}),a.when.apply(a,j.get()).done(function(){f(),a.each(arguments,function(){var b=this.el;a.each(this.diff,function(a){b.css(a,"")})}),i.complete.call(g[0])})})},a.fn.extend({addClass:function(b){return function(c,d,e,f){return d?a.effects.animateClass.call(this,{add:c},d,e,f):b.apply(this,arguments)}}(a.fn.addClass),removeClass:function(b){return function(c,d,e,f){return arguments.length>1?a.effects.animateClass.call(this,{remove:c},d,e,f):b.apply(this,arguments)}}(a.fn.removeClass),toggleClass:function(b){return function(c,d,e,f,g){return"boolean"==typeof d||void 0===d?e?a.effects.animateClass.call(this,d?{add:c}:{remove:c},e,f,g):b.apply(this,arguments):a.effects.animateClass.call(this,{toggle:c},d,e,f)}}(a.fn.toggleClass),switchClass:function(b,c,d,e,f){return a.effects.animateClass.call(this,{add:c,remove:b},d,e,f)}})}(),function(){function c(b,c,d,e){return a.isPlainObject(b)&&(c=b,b=b.effect),b={effect:b},null==c&&(c={}),a.isFunction(c)&&(e=c,d=null,c={}),("number"==typeof c||a.fx.speeds[c])&&(e=d,d=c,c={}),a.isFunction(d)&&(e=d,d=null),c&&a.extend(b,c),d=d||c.duration,b.duration=a.fx.off?0:"number"==typeof d?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,b.complete=e||c.complete,b}function d(b){return!(b&&"number"!=typeof b&&!a.fx.speeds[b])||("string"==typeof b&&!a.effects.effect[b]||(!!a.isFunction(b)||"object"==typeof b&&!b.effect))}a.extend(a.effects,{version:"1.11.4",save:function(a,c){for(var d=0;d").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:b.width(),height:b.height()},f=document.activeElement;try{f.id}catch(g){f=document.body}return b.wrap(d),(b[0]===f||a.contains(b[0],f))&&a(f).focus(),d=b.parent(),"static"===b.css("position")?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),b.css(e),d.css(c).show()},removeWrapper:function(b){var c=document.activeElement;return b.parent().is(".ui-effects-wrapper")&&(b.parent().replaceWith(b),(b[0]===c||a.contains(b[0],c))&&a(c).focus()),b},setTransition:function(b,c,d,e){return e=e||{},a.each(c,function(a,c){var f=b.cssUnit(c);f[0]>0&&(e[c]=f[0]*d+f[1])}),e}}),a.fn.extend({effect:function(){function b(b){function c(){a.isFunction(f)&&f.call(e[0]),a.isFunction(b)&&b()}var e=a(this),f=d.complete,h=d.mode;(e.is(":hidden")?"hide"===h:"show"===h)?(e[h](),c()):g.call(e[0],d,c)}var d=c.apply(this,arguments),e=d.mode,f=d.queue,g=a.effects.effect[d.effect];return a.fx.off||!g?e?this[e](d.duration,d.complete):this.each(function(){d.complete&&d.complete.call(this)}):f===!1?this.each(b):this.queue(f||"fx",b)},show:function(a){return function(b){if(d(b))return a.apply(this,arguments);var e=c.apply(this,arguments);return e.mode="show",this.effect.call(this,e)}}(a.fn.show),hide:function(a){return function(b){if(d(b))return a.apply(this,arguments);var e=c.apply(this,arguments);return e.mode="hide",this.effect.call(this,e)}}(a.fn.hide),toggle:function(a){return function(b){if(d(b)||"boolean"==typeof b)return a.apply(this,arguments);var e=c.apply(this,arguments);return e.mode="toggle",this.effect.call(this,e)}}(a.fn.toggle),cssUnit:function(b){var c=this.css(b),d=[];return a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])}),d}})}(),function(){var b={};a.each(["Quad","Cubic","Quart","Quint","Expo"],function(a,c){b[c]=function(b){return Math.pow(b,a+2)}}),a.extend(b,{Sine:function(a){return 1-Math.cos(a*Math.PI/2)},Circ:function(a){return 1-Math.sqrt(1-a*a)},Elastic:function(a){return 0===a||1===a?a:-Math.pow(2,8*(a-1))*Math.sin((80*(a-1)-7.5)*Math.PI/15)},Back:function(a){return a*a*(3*a-2)},Bounce:function(a){for(var b,c=4;a<((b=Math.pow(2,--c))-1)/11;);return 1/Math.pow(4,3-c)-7.5625*Math.pow((3*b-2)/22-a,2)}}),a.each(b,function(b,c){a.easing["easeIn"+b]=c,a.easing["easeOut"+b]=function(a){return 1-c(1-a)},a.easing["easeInOut"+b]=function(a){return a<.5?c(2*a)/2:1-c(a*-2+2)/2}})}(),a.effects});